home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / dev / scott.Z / scott / WWW / NextStep / Implementation / HyperText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-19  |  3.1 KB  |  102 lines

  1. //            HyperText Class
  2. //
  3.  
  4. #define HyperText HText
  5.  
  6. #import <appkit/Text.h>
  7. #import <objc/List.h>
  8. #import "HTAnchor.h"
  9. #import "HTStyle.h"
  10.  
  11. /*    Bit fields describing the capabilities of a node:
  12. */
  13. #define HT_READ            1
  14. #define HT_WRITE        2
  15. #define HT_LINK_TO_NODE        4
  16. #define HT_LINK_TO_PART        8
  17. #define HT_LINK_FROM_NODE    16
  18. #define HT_LINK_FROM_PART    32
  19. #define HT_DO_ANYTHING        63
  20.  
  21. extern void write_rtf_header(NXStream* rtfStream);
  22.  
  23. @interface HyperText:Text
  24. {
  25.  
  26.     HTParentAnchor * nodeAnchor;    //    An anchor representing the node
  27.     int    nextAnchorNumber; //    The serial number of the next anchor
  28.     int    protection;    //    Server capability authorised
  29.     int    slotNumber;    //    Window display position
  30.     int    format;        //    See WWW.h for values
  31.     HTStream    *target;    //    Output channel
  32.     HTStreamClass    targetClass;    //    Output routines
  33. }
  34.  
  35. + newAnchor:(HTParentAnchor*)anAnchor;
  36.  
  37. /* - readSGML:(NXStream*)sgmlStream diagnostic:(int)diagnostic; */
  38. - writeSGML:(HTStream*)sgmlStream relativeTo:(const char *)aName;
  39.  
  40. - readText:(NXStream*)stream;    //    Overrides Text's method.
  41.  
  42. - setupWindow;
  43. - adjustWindow;            // Adust scroll bars, sizeability, size, etc.
  44.  
  45. - (int) format;
  46. - setFormat:(int)format;
  47.  
  48. //    Style handling:
  49.  
  50. - applyToSimilar: (HTStyle *)style;    // Apply this style to the selection
  51. - applyStyle: (HTStyle *)style;        // Apply this style to the selection
  52. - selectUnstyled: (HTStyleSheet *)sheet;// Select the first unstyled run.
  53. - updateStyle: (HTStyle *)style;    // Update all text with changed style.
  54. - (HTStyle *)selectionStyle:(HTStyleSheet*)sheet; // style if any of  selection
  55. - replaceSel:(const char *)aString style:(HTStyle*)aStyle; // Paste in styled text
  56.  
  57. //    "Fast" Methods for external parsers:
  58.  
  59. - appendBegin;                // Start an append sequence
  60. - appendStyle:(HTStyle *) style;    // Set the style for future text
  61. - appendText: (const char *)text;    // Add a string
  62. - appendCharacter: (char)ch;        // Add a character
  63. -  (HTChildAnchor*)appendBeginAnchor: (HTChildAnchor*)anchor;
  64.                     // Begin an anchor
  65. - appendEndAnchor;            // End it
  66. - appendEnd;                // Flush out all additions so far
  67.  
  68.  
  69. //    Anchor handling:
  70.  
  71.  
  72. //- anchors;                // Set of anchors
  73. - (HTParentAnchor*) nodeAnchor;        // Single anchor representing this node
  74. - (HTChildAnchor*) selectedLink;    // Return selected anchor if any
  75. - (HTChildAnchor*)followLink;        // (If selected)
  76. - unlinkSelection;            // Remove anchor info from selection
  77. - (HTChildAnchor *) referenceSelected;    // Generate anchor for this node
  78. - (HTParentAnchor *) referenceAll;
  79. - (HTChildAnchor *) linkSelTo: (HTAnchor*)anchor;// Link selected text to this anchor.
  80. - disconnectAnchor: (HTChildAnchor*)anchor;    // Remove reference from this node.
  81. - selectAnchor: (HTChildAnchor*)anchor;    // Bring to front and highlight it.
  82.  
  83. - setTitle:(const char *)aString;
  84. - dump: sender;            // diagnostic output
  85.  
  86. //    Override methods of superclasses:
  87.  
  88. - readText: (NXStream *)stream;        // Also set format variable.
  89. - readRichText: (NXStream *)stream;    // Also set format variable.
  90. - mouseDown:(NXEvent*)theEvent;        // Double click become hyperjump
  91. - keyDown:(NXEvent*)theEvent;        //
  92. - paste:sender;                //
  93.  
  94. //    Window delegate methods:
  95.  
  96. - windowDidBecomeMain:sender;
  97.  
  98. @end
  99.  
  100. #import "HText.h"        /* Pick up everything about that class */
  101.  
  102.